package com.example.hms.controller;

import com.example.hms.entity.Live;
import com.example.hms.entity.Stay;
import com.example.hms.service.StayService;
import com.example.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/stay")
public class StayController {
    @Resource
    private StayService stayService;

    @RequestMapping(value = "selectAllStay", method = RequestMethod.GET)
    public Result selectAllStay(Stay stay)  {
        return stayService.selectAllStay(stay);
    }

    @RequestMapping(value = "/insertStay",method = RequestMethod.GET)
    public Result insertStay(Live live, HttpServletRequest request)
        {return stayService.insertStay(live,  request);}

    @RequestMapping(value = "/cancelStay",method = RequestMethod.GET)
    public Result cancelStay(Live live, HttpServletRequest request)
            {return stayService.cancelStay(live,request); }

    @RequestMapping(value = "/abrogateStay",method = RequestMethod.GET)
    public Result abrogateStay(Live live, HttpServletRequest request)
    {  return stayService.abrogateStay(live,request); }


}
